import request from '@/utils/request'

// 获取订单列表（管理员）
export const getOrderList = (params) => {
  return request({
    url: '/admin/orders',
    method: 'get',
    params
  })
}

// 获取订单详情（管理员）
export const getOrderDetail = (orderId) => {
  return request({
    url: `/admin/orders/${orderId}`,
    method: 'get'
  })
}

// 更新订单状态
export const updateOrderStatus = (orderId, data) => {
  return request({
    url: `/admin/orders/${orderId}/status`,
    method: 'put',
    data
  })
}

// 删除订单
export const deleteOrder = (orderId) => {
  return request({
    url: `/admin/orders/${orderId}`,
    method: 'delete'
  })
}

// 订单统计
export const getOrderStats = () => {
  return request({
    url: '/admin/stats/orders',  // 修改为匹配后端路由
    method: 'get'
  })
}


